Skip to content

apps: add git flags to create/update/deploy - #6182

Closed
atreyadbrx wants to merge 2 commits into
databricks:mainfrom
atreyadbrx:add-apps-git-flags
Closed

apps: add git flags to create/update/deploy#6182
atreyadbrx wants to merge 2 commits into
databricks:mainfrom
atreyadbrx:add-apps-git-flags

Conversation

@atreyadbrx

Copy link
Copy Markdown
Collaborator

The apps create/update/deploy commands accept a git repository and git deployment source, but the code generator emits these nested objects as // TODO: complex arg so they were only reachable via --json. Add ergonomic top-level flags for the GA git fields:

  • create/update: --git-url, --git-provider (App.GitRepository)
  • deploy: --git-branch, --git-tag, --git-commit, --git-source-code-path (AppDeployment.GitSource)

The nested SDK pointers stay nil unless a git flag is set, so non-git requests are unchanged. Validation matches the API contract: url and provider must be set together; branch/tag/commit are mutually exclusive; source-code-path requires a ref.

Co-authored-by: Isaac

Changes

Why

Tests

The apps create/update/deploy commands accept a git repository and git
deployment source, but the code generator emits these nested objects as
`// TODO: complex arg` so they were only reachable via --json. Add
ergonomic top-level flags for the GA git fields:

- create/update: --git-url, --git-provider (App.GitRepository)
- deploy: --git-branch, --git-tag, --git-commit, --git-source-code-path
  (AppDeployment.GitSource)

The nested SDK pointers stay nil unless a git flag is set, so non-git
requests are unchanged. Validation matches the API contract: url and
provider must be set together; branch/tag/commit are mutually exclusive;
source-code-path requires a ref.

Co-authored-by: Isaac
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

Based on git history, these people are best suited to review:

  • @pietern -- recent work in cmd/workspace/apps/

Eligible reviewers: @MarioCadenas, @Shridhad, @atilafassina, @calvarjorge, @ditadi, @fjakobs, @igrekun, @keugenek, @pffigueiredo, @pkosiec

Suggestions based on git history. See OWNERS for ownership rules.

golangci-lint's perfsprint linter flags fmt.Errorf with a static string
and no format verbs. Both git flag validation errors are constant
strings, so switch them to errors.New.

Co-authored-by: Isaac
@github-actions

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 6182
  • Commit SHA: bfd8cbf8765cac30f8d4e75717c2b55ecdfddd90

Checks will be approved automatically on success.

@atilafassina atilafassina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one little extra-check pending, let me know your thoughts

Comment on lines +64 to +71
if !refSet && !pathSet {
return nil
}
// A source-code path without a reference has no repository to resolve
// against — the reference is what selects the code to deploy.
if pathSet && !refSet {
return errors.New("--git-source-code-path requires one of --git-branch, --git-tag, or --git-commit")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should also reject --source-code-path before assigning git source, these params are mutually exclusive.

Otherwise the request can contain both workspace and Git source modes, which existing bundle validation treats as mutually exclusive.

@atreyadbrx

Copy link
Copy Markdown
Collaborator Author

Superseding this with #6371, opened as a same-repo (non-fork) branch so CI can run. It includes the same change plus @atilafassina's review feedback (rejecting the workspace --source-code-path when combined with the --git-* flags, since deployment_source is a oneof). Thanks for the review — carrying it over to #6371.

@atreyadbrx atreyadbrx closed this Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants